<template>
  <!-- 初体验 -->
  <div class="class">
    <h2>Vue 3 计数器</h2>
    <p>当前计数：{{ count }}</p>
    <button @click="increment">+1</button>
    <button @click="decrement">-1</button>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";

export default defineComponent({
  name: "A",
  setup() {
    const count = ref(0);

    const increment = () => {
      count.value++;
    };

    const decrement = () => {
      count.value--;
    };

    return {
      count,
      increment,
      decrement,
    };
  },
});
</script>

<style>
.class {
  background-color: aquamarine;
  width: 200px;
  height: 200px;
  text-align: center;
  padding-top: 50px;
}
</style>